# coding=utf-8
from urllib.parse import quote
import settings


def link_withdraw():
    return f"{settings.APP_SCHEME}://wallet/withdraw/"


def link_prompt(title, desc, btn_cancel="取消", btn_done="确定", link=""):
    return f"{settings.APP_SCHEME}://prompt/?title={quote(title)}&message={quote(desc)}" \
           f"&btn_cancel={quote(btn_cancel)}&btn_done={quote(btn_done)}&link={quote(link)}"


def link_copy_text(text):
    return f"{settings.APP_SCHEME}://copy_text/?text={quote(text)}"


def link_user(user_id):
    return f"{settings.APP_SCHEME}://user/{user_id}/"


def link_service(service_id):
    return f"{settings.APP_SCHEME}://service/{service_id}/"


def user_visitor():
    return "{settings.APP_SCHEME}://user_visitor/"


def show_toast(text, error):
    return f"{settings.APP_SCHEME}://toast/?text={quote(text)}&error={'1' if error else '0'}"


def wallet():
    return f"{settings.APP_SCHEME}://wallet/"


def coin_records():
    return f'{settings.APP_SCHEME}://coin_records/'


def wallet_charge():
    return f'{settings.APP_SCHEME}://wallet/pay/'


def wallet_withdraw():
    return f'{settings.APP_SCHEME}://wallet/withdraw/'


def orders():
    return f'{settings.APP_SCHEME}://orders/'


def follow_wechat():
    return f'{settings.APP_SCHEME}://follow_wechat/'


def app_rate(award: bool):
    return f"{settings.APP_SCHEME}://rate/?award={'1' if award else '0'}"


def app_update(build: int):
    return f"{settings.APP_SCHEME}://update/?build={build}"


def feedback():
    return f"{settings.APP_SCHEME}://feedback/"


def be_like_list():
    return f"{settings.APP_SCHEME}://be_like_list/"


def notify_comment_list():
    return f"{settings.APP_SCHEME}://notify_comment_list/"


def notify_like_list():
    return f"{settings.APP_SCHEME}://notify_like_list/"


def edit_profile():
    return f"{settings.APP_SCHEME}://edit_profile/"


def vip(force_buy: bool):
    return f"{settings.APP_SCHEME}://vip/?force={'1' if force_buy else '0'}"


def link_live(live_id):
    return f'{settings.APP_SCHEME}://live/{live_id}/'


def link_live2(live_id):
    return f'{settings.APP_SCHEME}://live2/{live_id}/'


def link_user_live_record(user_id):
    return f'{settings.APP_SCHEME}://user_live_record/{user_id}/'
